<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Box2D: b2World.h Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  <td id="projectlogo"><img alt="Logo" src="icon.gif"/></td>
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">Box2D
   &#160;<span id="projectnumber">2.2.1</span>
   </div>
   <div id="projectbrief">A 2D Physics Engine for Games</div>
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
<div class="header">
  <div class="headertitle">
<div class="title">b2World.h</div>  </div>
</div>
<div class="contents">
<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment">* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org</span>
<a name="l00003"></a>00003 <span class="comment">*</span>
<a name="l00004"></a>00004 <span class="comment">* This software is provided &#39;as-is&#39;, without any express or implied</span>
<a name="l00005"></a>00005 <span class="comment">* warranty.  In no event will the authors be held liable for any damages</span>
<a name="l00006"></a>00006 <span class="comment">* arising from the use of this software.</span>
<a name="l00007"></a>00007 <span class="comment">* Permission is granted to anyone to use this software for any purpose,</span>
<a name="l00008"></a>00008 <span class="comment">* including commercial applications, and to alter it and redistribute it</span>
<a name="l00009"></a>00009 <span class="comment">* freely, subject to the following restrictions:</span>
<a name="l00010"></a>00010 <span class="comment">* 1. The origin of this software must not be misrepresented; you must not</span>
<a name="l00011"></a>00011 <span class="comment">* claim that you wrote the original software. If you use this software</span>
<a name="l00012"></a>00012 <span class="comment">* in a product, an acknowledgment in the product documentation would be</span>
<a name="l00013"></a>00013 <span class="comment">* appreciated but is not required.</span>
<a name="l00014"></a>00014 <span class="comment">* 2. Altered source versions must be plainly marked as such, and must not be</span>
<a name="l00015"></a>00015 <span class="comment">* misrepresented as being the original software.</span>
<a name="l00016"></a>00016 <span class="comment">* 3. This notice may not be removed or altered from any source distribution.</span>
<a name="l00017"></a>00017 <span class="comment">*/</span>
<a name="l00018"></a>00018 
<a name="l00019"></a>00019 <span class="preprocessor">#ifndef B2_WORLD_H</span>
<a name="l00020"></a>00020 <span class="preprocessor"></span><span class="preprocessor">#define B2_WORLD_H</span>
<a name="l00021"></a>00021 <span class="preprocessor"></span>
<a name="l00022"></a>00022 <span class="preprocessor">#include &lt;Box2D/Common/b2Math.h&gt;</span>
<a name="l00023"></a>00023 <span class="preprocessor">#include &lt;Box2D/Common/b2BlockAllocator.h&gt;</span>
<a name="l00024"></a>00024 <span class="preprocessor">#include &lt;Box2D/Common/b2StackAllocator.h&gt;</span>
<a name="l00025"></a>00025 <span class="preprocessor">#include &lt;Box2D/Dynamics/b2ContactManager.h&gt;</span>
<a name="l00026"></a>00026 <span class="preprocessor">#include &lt;Box2D/Dynamics/b2WorldCallbacks.h&gt;</span>
<a name="l00027"></a>00027 <span class="preprocessor">#include &lt;Box2D/Dynamics/b2TimeStep.h&gt;</span>
<a name="l00028"></a>00028 
<a name="l00029"></a>00029 <span class="keyword">struct </span><a class="code" href="structb2_a_a_b_b.html" title="An axis aligned bounding box.">b2AABB</a>;
<a name="l00030"></a>00030 <span class="keyword">struct </span><a class="code" href="structb2_body_def.html">b2BodyDef</a>;
<a name="l00031"></a>00031 <span class="keyword">struct </span><a class="code" href="structb2_color.html" title="Color for debug drawing. Each value has the range [0,1].">b2Color</a>;
<a name="l00032"></a>00032 <span class="keyword">struct </span><a class="code" href="structb2_joint_def.html" title="Joint definitions are used to construct joints.">b2JointDef</a>;
<a name="l00033"></a>00033 <span class="keyword">class </span><a class="code" href="classb2_body.html" title="A rigid body. These are created via b2World::CreateBody.">b2Body</a>;
<a name="l00034"></a>00034 <span class="keyword">class </span><a class="code" href="classb2_draw.html">b2Draw</a>;
<a name="l00035"></a>00035 <span class="keyword">class </span><a class="code" href="classb2_fixture.html">b2Fixture</a>;
<a name="l00036"></a>00036 <span class="keyword">class </span><a class="code" href="classb2_joint.html">b2Joint</a>;
<a name="l00037"></a>00037 
<a name="l00041"></a><a class="code" href="classb2_world.html">00041</a> <span class="keyword">class </span><a class="code" href="classb2_world.html">b2World</a>
<a name="l00042"></a>00042 {
<a name="l00043"></a>00043 <span class="keyword">public</span>:
<a name="l00046"></a>00046         <a class="code" href="classb2_world.html#aeccc87fd9e36702c821a8244ca7cd875">b2World</a>(<span class="keyword">const</span> <a class="code" href="structb2_vec2.html" title="A 2D column vector.">b2Vec2</a>&amp; gravity);
<a name="l00047"></a>00047 
<a name="l00049"></a>00049         <a class="code" href="classb2_world.html#a5250ae4487475c33ccefdead07c768c8" title="Destruct the world. All physics entities are destroyed and all heap memory is released.">~b2World</a>();
<a name="l00050"></a>00050 
<a name="l00053"></a>00053         <span class="keywordtype">void</span> <a class="code" href="classb2_world.html#ae377f2dd5512ada7d27f4ad3541c75bf">SetDestructionListener</a>(<a class="code" href="classb2_destruction_listener.html">b2DestructionListener</a>* listener);
<a name="l00054"></a>00054 
<a name="l00058"></a>00058         <span class="keywordtype">void</span> <a class="code" href="classb2_world.html#a85e6e1e911c7d6366f8c7d57a12b72ff">SetContactFilter</a>(<a class="code" href="classb2_contact_filter.html">b2ContactFilter</a>* filter);
<a name="l00059"></a>00059 
<a name="l00062"></a>00062         <span class="keywordtype">void</span> <a class="code" href="classb2_world.html#a614549967fb8a1584b61c11e2d553d42">SetContactListener</a>(<a class="code" href="classb2_contact_listener.html">b2ContactListener</a>* listener);
<a name="l00063"></a>00063 
<a name="l00067"></a>00067         <span class="keywordtype">void</span> <a class="code" href="classb2_world.html#a6976d2c67400df03c0d44174ffcfb7ee">SetDebugDraw</a>(<a class="code" href="classb2_draw.html">b2Draw</a>* debugDraw);
<a name="l00068"></a>00068 
<a name="l00072"></a>00072         <a class="code" href="classb2_body.html" title="A rigid body. These are created via b2World::CreateBody.">b2Body</a>* <a class="code" href="classb2_world.html#a2eb36e967e43294bfa03ec3d177c2dae">CreateBody</a>(<span class="keyword">const</span> <a class="code" href="structb2_body_def.html">b2BodyDef</a>* def);
<a name="l00073"></a>00073 
<a name="l00078"></a>00078         <span class="keywordtype">void</span> <a class="code" href="classb2_world.html#ad52231ad7a9556ef5735ac79cbcd8fcf">DestroyBody</a>(<a class="code" href="classb2_body.html" title="A rigid body. These are created via b2World::CreateBody.">b2Body</a>* body);
<a name="l00079"></a>00079 
<a name="l00083"></a>00083         <a class="code" href="classb2_joint.html">b2Joint</a>* <a class="code" href="classb2_world.html#a5cba9d0653149eb62504154e6fb35021">CreateJoint</a>(<span class="keyword">const</span> <a class="code" href="structb2_joint_def.html" title="Joint definitions are used to construct joints.">b2JointDef</a>* def);
<a name="l00084"></a>00084 
<a name="l00087"></a>00087         <span class="keywordtype">void</span> <a class="code" href="classb2_world.html#add5942aef171e54cfa384c8975746dca">DestroyJoint</a>(<a class="code" href="classb2_joint.html">b2Joint</a>* joint);
<a name="l00088"></a>00088 
<a name="l00094"></a>00094         <span class="keywordtype">void</span> <a class="code" href="classb2_world.html#a7a8eff61af98461f978fe43f3af7be90">Step</a>(      float32 timeStep,
<a name="l00095"></a>00095                                 int32 velocityIterations,
<a name="l00096"></a>00096                                 int32 positionIterations);
<a name="l00097"></a>00097 
<a name="l00105"></a>00105         <span class="keywordtype">void</span> <a class="code" href="classb2_world.html#ac082ab4c4ad0b1c5ec4674315eeec643">ClearForces</a>();
<a name="l00106"></a>00106 
<a name="l00108"></a>00108         <span class="keywordtype">void</span> <a class="code" href="classb2_world.html#a293d9865e407fd463e168b0a29856acc" title="Call this to draw shapes and other debug draw data.">DrawDebugData</a>();
<a name="l00109"></a>00109 
<a name="l00114"></a>00114         <span class="keywordtype">void</span> <a class="code" href="classb2_world.html#a711e55d2c6e68400f93472f807c3775b">QueryAABB</a>(<a class="code" href="classb2_query_callback.html">b2QueryCallback</a>* callback, <span class="keyword">const</span> <a class="code" href="structb2_a_a_b_b.html" title="An axis aligned bounding box.">b2AABB</a>&amp; aabb) <span class="keyword">const</span>;
<a name="l00115"></a>00115 
<a name="l00122"></a>00122         <span class="keywordtype">void</span> <a class="code" href="classb2_world.html#ad902548be84df9cc36eced0f4c89ab0a">RayCast</a>(<a class="code" href="classb2_ray_cast_callback.html">b2RayCastCallback</a>* callback, <span class="keyword">const</span> <a class="code" href="structb2_vec2.html" title="A 2D column vector.">b2Vec2</a>&amp; point1, <span class="keyword">const</span> <a class="code" href="structb2_vec2.html" title="A 2D column vector.">b2Vec2</a>&amp; point2) <span class="keyword">const</span>;
<a name="l00123"></a>00123 
<a name="l00127"></a>00127         <a class="code" href="classb2_body.html" title="A rigid body. These are created via b2World::CreateBody.">b2Body</a>* <a class="code" href="classb2_world.html#a1b87c03955e3312d308ddf679adf3c85">GetBodyList</a>();
<a name="l00128"></a>00128         <span class="keyword">const</span> <a class="code" href="classb2_body.html" title="A rigid body. These are created via b2World::CreateBody.">b2Body</a>* <a class="code" href="classb2_world.html#a1b87c03955e3312d308ddf679adf3c85">GetBodyList</a>() <span class="keyword">const</span>;
<a name="l00129"></a>00129 
<a name="l00133"></a>00133         <a class="code" href="classb2_joint.html">b2Joint</a>* <a class="code" href="classb2_world.html#a55db7240f8290aa02cab79f181934de8">GetJointList</a>();
<a name="l00134"></a>00134         <span class="keyword">const</span> <a class="code" href="classb2_joint.html">b2Joint</a>* <a class="code" href="classb2_world.html#a55db7240f8290aa02cab79f181934de8">GetJointList</a>() <span class="keyword">const</span>;
<a name="l00135"></a>00135 
<a name="l00141"></a>00141         <a class="code" href="classb2_contact.html">b2Contact</a>* <a class="code" href="classb2_world.html#ab1e1c59fd7534c0268c2a3e31370a425">GetContactList</a>();
<a name="l00142"></a>00142         <span class="keyword">const</span> <a class="code" href="classb2_contact.html">b2Contact</a>* <a class="code" href="classb2_world.html#ab1e1c59fd7534c0268c2a3e31370a425">GetContactList</a>() <span class="keyword">const</span>;
<a name="l00143"></a>00143 
<a name="l00145"></a>00145         <span class="keywordtype">void</span> <a class="code" href="classb2_world.html#a6755872564fc3db70c69d2b9d349fa33" title="Enable/disable sleep.">SetAllowSleeping</a>(<span class="keywordtype">bool</span> flag);
<a name="l00146"></a>00146         <span class="keywordtype">bool</span> GetAllowSleeping()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_allowSleep; }
<a name="l00147"></a>00147 
<a name="l00149"></a><a class="code" href="classb2_world.html#a8e8c12142e8c4884a18787926a261359">00149</a>         <span class="keywordtype">void</span> <a class="code" href="classb2_world.html#a8e8c12142e8c4884a18787926a261359" title="Enable/disable warm starting. For testing.">SetWarmStarting</a>(<span class="keywordtype">bool</span> flag) { m_warmStarting = flag; }
<a name="l00150"></a>00150         <span class="keywordtype">bool</span> GetWarmStarting()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_warmStarting; }
<a name="l00151"></a>00151 
<a name="l00153"></a><a class="code" href="classb2_world.html#a536dd9181c2e20096073e3cfe2c8530a">00153</a>         <span class="keywordtype">void</span> <a class="code" href="classb2_world.html#a536dd9181c2e20096073e3cfe2c8530a" title="Enable/disable continuous physics. For testing.">SetContinuousPhysics</a>(<span class="keywordtype">bool</span> flag) { m_continuousPhysics = flag; }
<a name="l00154"></a>00154         <span class="keywordtype">bool</span> GetContinuousPhysics()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_continuousPhysics; }
<a name="l00155"></a>00155 
<a name="l00157"></a><a class="code" href="classb2_world.html#ae8aacc78ea4753075067daff51b61778">00157</a>         <span class="keywordtype">void</span> <a class="code" href="classb2_world.html#ae8aacc78ea4753075067daff51b61778" title="Enable/disable single stepped continuous physics. For testing.">SetSubStepping</a>(<span class="keywordtype">bool</span> flag) { m_subStepping = flag; }
<a name="l00158"></a>00158         <span class="keywordtype">bool</span> GetSubStepping()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_subStepping; }
<a name="l00159"></a>00159 
<a name="l00161"></a>00161         int32 <a class="code" href="classb2_world.html#a67f1f9fbdd85abd2100104c5eabe17cb" title="Get the number of broad-phase proxies.">GetProxyCount</a>() <span class="keyword">const</span>;
<a name="l00162"></a>00162 
<a name="l00164"></a>00164         int32 <a class="code" href="classb2_world.html#a4559122ea51401b4fb7342eb6232ce74" title="Get the number of bodies.">GetBodyCount</a>() <span class="keyword">const</span>;
<a name="l00165"></a>00165 
<a name="l00167"></a>00167         int32 <a class="code" href="classb2_world.html#a54a95a98787ed5f383c6549ee1f4c4d5" title="Get the number of joints.">GetJointCount</a>() <span class="keyword">const</span>;
<a name="l00168"></a>00168 
<a name="l00170"></a>00170         int32 <a class="code" href="classb2_world.html#abcc976f1755f9bb94a8650f5f4219a8d" title="Get the number of contacts (each may have 0 or more contact points).">GetContactCount</a>() <span class="keyword">const</span>;
<a name="l00171"></a>00171 
<a name="l00173"></a>00173         int32 <a class="code" href="classb2_world.html#a48f90a31dc2ad30dbc50cac5111400d7" title="Get the height of the dynamic tree.">GetTreeHeight</a>() <span class="keyword">const</span>;
<a name="l00174"></a>00174 
<a name="l00176"></a>00176         int32 <a class="code" href="classb2_world.html#a9fb7c28d042b600ba1155e3d38f1c5f9" title="Get the balance of the dynamic tree.">GetTreeBalance</a>() <span class="keyword">const</span>;
<a name="l00177"></a>00177 
<a name="l00180"></a>00180         float32 <a class="code" href="classb2_world.html#a0e9dceab7052fd6e0d73d6024cca1bcb">GetTreeQuality</a>() <span class="keyword">const</span>;
<a name="l00181"></a>00181 
<a name="l00183"></a>00183         <span class="keywordtype">void</span> <a class="code" href="classb2_world.html#aeafa43d6580e1dddb0675e672ca2375c" title="Change the global gravity vector.">SetGravity</a>(<span class="keyword">const</span> <a class="code" href="structb2_vec2.html" title="A 2D column vector.">b2Vec2</a>&amp; gravity);
<a name="l00184"></a>00184         
<a name="l00186"></a>00186         <a class="code" href="structb2_vec2.html" title="A 2D column vector.">b2Vec2</a> <a class="code" href="classb2_world.html#a1e34bcd2f75fbdd41e2d84b3eb26d1ab" title="Get the global gravity vector.">GetGravity</a>() <span class="keyword">const</span>;
<a name="l00187"></a>00187 
<a name="l00189"></a>00189         <span class="keywordtype">bool</span> <a class="code" href="classb2_world.html#ae50c318304546c9cc066ee382668c4a1" title="Is the world locked (in the middle of a time step).">IsLocked</a>() <span class="keyword">const</span>;
<a name="l00190"></a>00190 
<a name="l00192"></a>00192         <span class="keywordtype">void</span> <a class="code" href="classb2_world.html#aa2bced28ddef5bbb00ed5666e5e9f620" title="Set flag to control automatic clearing of forces after each time step.">SetAutoClearForces</a>(<span class="keywordtype">bool</span> flag);
<a name="l00193"></a>00193 
<a name="l00195"></a>00195         <span class="keywordtype">bool</span> <a class="code" href="classb2_world.html#af56cc43ebde27946ed39382b4ea31640" title="Get the flag that controls automatic clearing of forces after each time step.">GetAutoClearForces</a>() <span class="keyword">const</span>;
<a name="l00196"></a>00196 
<a name="l00198"></a>00198         <span class="keyword">const</span> <a class="code" href="classb2_contact_manager.html">b2ContactManager</a>&amp; <a class="code" href="classb2_world.html#a16259159ae1719c30808561c990a8c05" title="Get the contact manager for testing.">GetContactManager</a>() <span class="keyword">const</span>;
<a name="l00199"></a>00199 
<a name="l00201"></a>00201         <span class="keyword">const</span> <a class="code" href="structb2_profile.html" title="Profiling data. Times are in milliseconds.">b2Profile</a>&amp; <a class="code" href="classb2_world.html#af41b3f1a21efc854b485d311911e24b2" title="Get the current profile.">GetProfile</a>() <span class="keyword">const</span>;
<a name="l00202"></a>00202 
<a name="l00205"></a>00205         <span class="keywordtype">void</span> <a class="code" href="classb2_world.html#a73c1fec260d460514edd335d4c235893">Dump</a>();
<a name="l00206"></a>00206 
<a name="l00207"></a>00207 <span class="keyword">private</span>:
<a name="l00208"></a>00208 
<a name="l00209"></a>00209         <span class="comment">// m_flags</span>
<a name="l00210"></a>00210         <span class="keyword">enum</span>
<a name="l00211"></a>00211         {
<a name="l00212"></a>00212                 e_newFixture    = 0x0001,
<a name="l00213"></a>00213                 e_locked                = 0x0002,
<a name="l00214"></a>00214                 e_clearForces   = 0x0004
<a name="l00215"></a>00215         };
<a name="l00216"></a>00216 
<a name="l00217"></a>00217         <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classb2_body.html" title="A rigid body. These are created via b2World::CreateBody.">b2Body</a>;
<a name="l00218"></a>00218         <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classb2_fixture.html">b2Fixture</a>;
<a name="l00219"></a>00219         <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classb2_contact_manager.html">b2ContactManager</a>;
<a name="l00220"></a>00220         <span class="keyword">friend</span> <span class="keyword">class </span>b2Controller;
<a name="l00221"></a>00221 
<a name="l00222"></a>00222         <span class="keywordtype">void</span> Solve(<span class="keyword">const</span> <a class="code" href="structb2_time_step.html" title="This is an internal structure.">b2TimeStep</a>&amp; step);
<a name="l00223"></a>00223         <span class="keywordtype">void</span> SolveTOI(<span class="keyword">const</span> <a class="code" href="structb2_time_step.html" title="This is an internal structure.">b2TimeStep</a>&amp; step);
<a name="l00224"></a>00224 
<a name="l00225"></a>00225         <span class="keywordtype">void</span> DrawJoint(<a class="code" href="classb2_joint.html">b2Joint</a>* joint);
<a name="l00226"></a>00226         <span class="keywordtype">void</span> DrawShape(<a class="code" href="classb2_fixture.html">b2Fixture</a>* shape, <span class="keyword">const</span> <a class="code" href="structb2_transform.html">b2Transform</a>&amp; xf, <span class="keyword">const</span> <a class="code" href="structb2_color.html" title="Color for debug drawing. Each value has the range [0,1].">b2Color</a>&amp; color);
<a name="l00227"></a>00227 
<a name="l00228"></a>00228         <a class="code" href="classb2_block_allocator.html">b2BlockAllocator</a> m_blockAllocator;
<a name="l00229"></a>00229         <a class="code" href="classb2_stack_allocator.html">b2StackAllocator</a> m_stackAllocator;
<a name="l00230"></a>00230 
<a name="l00231"></a>00231         int32 m_flags;
<a name="l00232"></a>00232 
<a name="l00233"></a>00233         <a class="code" href="classb2_contact_manager.html">b2ContactManager</a> m_contactManager;
<a name="l00234"></a>00234 
<a name="l00235"></a>00235         <a class="code" href="classb2_body.html" title="A rigid body. These are created via b2World::CreateBody.">b2Body</a>* m_bodyList;
<a name="l00236"></a>00236         <a class="code" href="classb2_joint.html">b2Joint</a>* m_jointList;
<a name="l00237"></a>00237 
<a name="l00238"></a>00238         int32 m_bodyCount;
<a name="l00239"></a>00239         int32 m_jointCount;
<a name="l00240"></a>00240 
<a name="l00241"></a>00241         <a class="code" href="structb2_vec2.html" title="A 2D column vector.">b2Vec2</a> m_gravity;
<a name="l00242"></a>00242         <span class="keywordtype">bool</span> m_allowSleep;
<a name="l00243"></a>00243 
<a name="l00244"></a>00244         <a class="code" href="classb2_destruction_listener.html">b2DestructionListener</a>* m_destructionListener;
<a name="l00245"></a>00245         <a class="code" href="classb2_draw.html">b2Draw</a>* m_debugDraw;
<a name="l00246"></a>00246 
<a name="l00247"></a>00247         <span class="comment">// This is used to compute the time step ratio to</span>
<a name="l00248"></a>00248         <span class="comment">// support a variable time step.</span>
<a name="l00249"></a>00249         float32 m_inv_dt0;
<a name="l00250"></a>00250 
<a name="l00251"></a>00251         <span class="comment">// These are for debugging the solver.</span>
<a name="l00252"></a>00252         <span class="keywordtype">bool</span> m_warmStarting;
<a name="l00253"></a>00253         <span class="keywordtype">bool</span> m_continuousPhysics;
<a name="l00254"></a>00254         <span class="keywordtype">bool</span> m_subStepping;
<a name="l00255"></a>00255 
<a name="l00256"></a>00256         <span class="keywordtype">bool</span> m_stepComplete;
<a name="l00257"></a>00257 
<a name="l00258"></a>00258         <a class="code" href="structb2_profile.html" title="Profiling data. Times are in milliseconds.">b2Profile</a> m_profile;
<a name="l00259"></a>00259 };
<a name="l00260"></a>00260 
<a name="l00261"></a><a class="code" href="classb2_world.html#a1b87c03955e3312d308ddf679adf3c85">00261</a> <span class="keyword">inline</span> <a class="code" href="classb2_body.html" title="A rigid body. These are created via b2World::CreateBody.">b2Body</a>* <a class="code" href="classb2_world.html#a1b87c03955e3312d308ddf679adf3c85">b2World::GetBodyList</a>()
<a name="l00262"></a>00262 {
<a name="l00263"></a>00263         <span class="keywordflow">return</span> m_bodyList;
<a name="l00264"></a>00264 }
<a name="l00265"></a>00265 
<a name="l00266"></a>00266 <span class="keyword">inline</span> <span class="keyword">const</span> <a class="code" href="classb2_body.html" title="A rigid body. These are created via b2World::CreateBody.">b2Body</a>* <a class="code" href="classb2_world.html#a1b87c03955e3312d308ddf679adf3c85">b2World::GetBodyList</a>()<span class="keyword"> const</span>
<a name="l00267"></a>00267 <span class="keyword"></span>{
<a name="l00268"></a>00268         <span class="keywordflow">return</span> m_bodyList;
<a name="l00269"></a>00269 }
<a name="l00270"></a>00270 
<a name="l00271"></a><a class="code" href="classb2_world.html#a55db7240f8290aa02cab79f181934de8">00271</a> <span class="keyword">inline</span> <a class="code" href="classb2_joint.html">b2Joint</a>* <a class="code" href="classb2_world.html#a55db7240f8290aa02cab79f181934de8">b2World::GetJointList</a>()
<a name="l00272"></a>00272 {
<a name="l00273"></a>00273         <span class="keywordflow">return</span> m_jointList;
<a name="l00274"></a>00274 }
<a name="l00275"></a>00275 
<a name="l00276"></a>00276 <span class="keyword">inline</span> <span class="keyword">const</span> <a class="code" href="classb2_joint.html">b2Joint</a>* <a class="code" href="classb2_world.html#a55db7240f8290aa02cab79f181934de8">b2World::GetJointList</a>()<span class="keyword"> const</span>
<a name="l00277"></a>00277 <span class="keyword"></span>{
<a name="l00278"></a>00278         <span class="keywordflow">return</span> m_jointList;
<a name="l00279"></a>00279 }
<a name="l00280"></a>00280 
<a name="l00281"></a><a class="code" href="classb2_world.html#ab1e1c59fd7534c0268c2a3e31370a425">00281</a> <span class="keyword">inline</span> <a class="code" href="classb2_contact.html">b2Contact</a>* <a class="code" href="classb2_world.html#ab1e1c59fd7534c0268c2a3e31370a425">b2World::GetContactList</a>()
<a name="l00282"></a>00282 {
<a name="l00283"></a>00283         <span class="keywordflow">return</span> m_contactManager.m_contactList;
<a name="l00284"></a>00284 }
<a name="l00285"></a>00285 
<a name="l00286"></a>00286 <span class="keyword">inline</span> <span class="keyword">const</span> <a class="code" href="classb2_contact.html">b2Contact</a>* <a class="code" href="classb2_world.html#ab1e1c59fd7534c0268c2a3e31370a425">b2World::GetContactList</a>()<span class="keyword"> const</span>
<a name="l00287"></a>00287 <span class="keyword"></span>{
<a name="l00288"></a>00288         <span class="keywordflow">return</span> m_contactManager.m_contactList;
<a name="l00289"></a>00289 }
<a name="l00290"></a>00290 
<a name="l00291"></a><a class="code" href="classb2_world.html#a4559122ea51401b4fb7342eb6232ce74">00291</a> <span class="keyword">inline</span> int32 <a class="code" href="classb2_world.html#a4559122ea51401b4fb7342eb6232ce74" title="Get the number of bodies.">b2World::GetBodyCount</a>()<span class="keyword"> const</span>
<a name="l00292"></a>00292 <span class="keyword"></span>{
<a name="l00293"></a>00293         <span class="keywordflow">return</span> m_bodyCount;
<a name="l00294"></a>00294 }
<a name="l00295"></a>00295 
<a name="l00296"></a><a class="code" href="classb2_world.html#a54a95a98787ed5f383c6549ee1f4c4d5">00296</a> <span class="keyword">inline</span> int32 <a class="code" href="classb2_world.html#a54a95a98787ed5f383c6549ee1f4c4d5" title="Get the number of joints.">b2World::GetJointCount</a>()<span class="keyword"> const</span>
<a name="l00297"></a>00297 <span class="keyword"></span>{
<a name="l00298"></a>00298         <span class="keywordflow">return</span> m_jointCount;
<a name="l00299"></a>00299 }
<a name="l00300"></a>00300 
<a name="l00301"></a><a class="code" href="classb2_world.html#abcc976f1755f9bb94a8650f5f4219a8d">00301</a> <span class="keyword">inline</span> int32 <a class="code" href="classb2_world.html#abcc976f1755f9bb94a8650f5f4219a8d" title="Get the number of contacts (each may have 0 or more contact points).">b2World::GetContactCount</a>()<span class="keyword"> const</span>
<a name="l00302"></a>00302 <span class="keyword"></span>{
<a name="l00303"></a>00303         <span class="keywordflow">return</span> m_contactManager.m_contactCount;
<a name="l00304"></a>00304 }
<a name="l00305"></a>00305 
<a name="l00306"></a><a class="code" href="classb2_world.html#aeafa43d6580e1dddb0675e672ca2375c">00306</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classb2_world.html#aeafa43d6580e1dddb0675e672ca2375c" title="Change the global gravity vector.">b2World::SetGravity</a>(<span class="keyword">const</span> <a class="code" href="structb2_vec2.html" title="A 2D column vector.">b2Vec2</a>&amp; gravity)
<a name="l00307"></a>00307 {
<a name="l00308"></a>00308         m_gravity = gravity;
<a name="l00309"></a>00309 }
<a name="l00310"></a>00310 
<a name="l00311"></a><a class="code" href="classb2_world.html#a1e34bcd2f75fbdd41e2d84b3eb26d1ab">00311</a> <span class="keyword">inline</span> <a class="code" href="structb2_vec2.html" title="A 2D column vector.">b2Vec2</a> <a class="code" href="classb2_world.html#a1e34bcd2f75fbdd41e2d84b3eb26d1ab" title="Get the global gravity vector.">b2World::GetGravity</a>()<span class="keyword"> const</span>
<a name="l00312"></a>00312 <span class="keyword"></span>{
<a name="l00313"></a>00313         <span class="keywordflow">return</span> m_gravity;
<a name="l00314"></a>00314 }
<a name="l00315"></a>00315 
<a name="l00316"></a><a class="code" href="classb2_world.html#ae50c318304546c9cc066ee382668c4a1">00316</a> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="classb2_world.html#ae50c318304546c9cc066ee382668c4a1" title="Is the world locked (in the middle of a time step).">b2World::IsLocked</a>()<span class="keyword"> const</span>
<a name="l00317"></a>00317 <span class="keyword"></span>{
<a name="l00318"></a>00318         <span class="keywordflow">return</span> (m_flags &amp; e_locked) == e_locked;
<a name="l00319"></a>00319 }
<a name="l00320"></a>00320 
<a name="l00321"></a><a class="code" href="classb2_world.html#aa2bced28ddef5bbb00ed5666e5e9f620">00321</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classb2_world.html#aa2bced28ddef5bbb00ed5666e5e9f620" title="Set flag to control automatic clearing of forces after each time step.">b2World::SetAutoClearForces</a>(<span class="keywordtype">bool</span> flag)
<a name="l00322"></a>00322 {
<a name="l00323"></a>00323         <span class="keywordflow">if</span> (flag)
<a name="l00324"></a>00324         {
<a name="l00325"></a>00325                 m_flags |= e_clearForces;
<a name="l00326"></a>00326         }
<a name="l00327"></a>00327         <span class="keywordflow">else</span>
<a name="l00328"></a>00328         {
<a name="l00329"></a>00329                 m_flags &amp;= ~e_clearForces;
<a name="l00330"></a>00330         }
<a name="l00331"></a>00331 }
<a name="l00332"></a>00332 
<a name="l00334"></a><a class="code" href="classb2_world.html#af56cc43ebde27946ed39382b4ea31640">00334</a> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="classb2_world.html#af56cc43ebde27946ed39382b4ea31640" title="Get the flag that controls automatic clearing of forces after each time step.">b2World::GetAutoClearForces</a>()<span class="keyword"> const</span>
<a name="l00335"></a>00335 <span class="keyword"></span>{
<a name="l00336"></a>00336         <span class="keywordflow">return</span> (m_flags &amp; e_clearForces) == e_clearForces;
<a name="l00337"></a>00337 }
<a name="l00338"></a>00338 
<a name="l00339"></a><a class="code" href="classb2_world.html#a16259159ae1719c30808561c990a8c05">00339</a> <span class="keyword">inline</span> <span class="keyword">const</span> <a class="code" href="classb2_contact_manager.html">b2ContactManager</a>&amp; <a class="code" href="classb2_world.html#a16259159ae1719c30808561c990a8c05" title="Get the contact manager for testing.">b2World::GetContactManager</a>()<span class="keyword"> const</span>
<a name="l00340"></a>00340 <span class="keyword"></span>{
<a name="l00341"></a>00341         <span class="keywordflow">return</span> m_contactManager;
<a name="l00342"></a>00342 }
<a name="l00343"></a>00343 
<a name="l00344"></a><a class="code" href="classb2_world.html#af41b3f1a21efc854b485d311911e24b2">00344</a> <span class="keyword">inline</span> <span class="keyword">const</span> <a class="code" href="structb2_profile.html" title="Profiling data. Times are in milliseconds.">b2Profile</a>&amp; <a class="code" href="classb2_world.html#af41b3f1a21efc854b485d311911e24b2" title="Get the current profile.">b2World::GetProfile</a>()<span class="keyword"> const</span>
<a name="l00345"></a>00345 <span class="keyword"></span>{
<a name="l00346"></a>00346         <span class="keywordflow">return</span> m_profile;
<a name="l00347"></a>00347 }
<a name="l00348"></a>00348 
<a name="l00349"></a>00349 <span class="preprocessor">#endif</span>
</pre></div></div>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>



<hr class="footer"/><address class="footer"><small>
Generated on Sat Sep 17 2011 17:35:55 for Box2D by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.5.1
</small></address>

</body>
</html>
